import { Context, controller, inject, provide, post} from 'midway';
import { IVerificaService} from '../interface';

@provide()
@controller('/')
export class VerificaController {

  @inject()
  ctx: Context;
  @inject('verificationService')
  service: IVerificaService;

  @post('/getPhone')
  async getPhone(): Promise<void> {
     const {mobile} = this.ctx.request.body;
   const Message=await this.service.getPhone(mobile)
    if(Message=='OK'){
      this.ctx.body = {success: true, message: 'OK'};
    }else{
      this.ctx.body = {success: false, mess: 'error'};
    }
  }
}